{% extends "base.html" %}
{% import "bootstrap/wtf.html" as wtf %}
{% import "_macros.html" as macros %}


 

{% block page_content %}
<!-- <ol class="breadcrumb">
    <li><a href="{{ url_for('.index') }}">翻相册</a></li>
    <li class="active">{% if current_user == user %}我{% else %}{{ user.name }}{% endif %}的相册</li>
    <li><a href="{{ url_for('main.likes', username=user.username) }}">{% if current_user == user %}我{% else %}{{
        user.name }}{% endif %}的喜欢</a></li>
    {% if user == current_user %}
    <li class="pull-right"><a href="{{ url_for('.edit_profile') }}">编辑资料</a></li>
    {% endif %}
    {% if current_user.is_administrator() %}
    <li class="pull-right"><a href="{{ url_for('.edit_profile_admin', id=user.id) }}">编辑 [Admin]</a></li>
    {% endif %}
</ol> -->
<div class="col-lg-12">
            <ol class="breadcrumb">
                <li class="active">
                    <strong>陌上花开，可缓缓归矣.</strong><br>
                </li>
            </ol>
        </div>
<div class="row">
    <div class="col-md-9">
        <div class="text-center container-fluid">
            {% if album_count == 0 %}
            {% if current_user == user %}
            <h3>你还没有相册，快来<a href="{{ url_for('.new_album') }}">创建</a>一个吧！</h3>
            {% else %}
            <h3>他/她还没有创建相册。</h3>
            {% endif %}
            {% endif %}
            <div class="row text-center">
                {% for album in albums %}
                {% if not album.no_public or current_user == user %}
                <div class="album col-md-3">
                    <div class="album-frame">
                        <a class="thumbnail album-thumbnail" href="{{ url_for('.album', id=album.id) }}">
                            <img class="img-responsive portrait" src="{{ album.cover }}">
                        </a>
                    </div>
                    <div class="info">
                        <h5><a href="{{ url_for('.album', id=album.id) }}">{{ album.title }}</a></h5>
                        <span>{{ album.photos.count() }}张图片</span>
                        <span>创建于{{ moment(album.timestamp).format('L') }}</span>
                        {% if current_user.is_authenticated %}
                        </span>是否私密: 
                            {% if album.no_public %}
                                是
                            {% else %}
                                否
                            {% endif %}
                        {% endif %}
                        <span>
                        
                    </div>
                </div>
                {% endif %}
                {% endfor %}
            </div>
        </div>
    </div>
    
    <div class="container-fluid col-md-3">
        <div class="center-text user-area text-center">
            <p>
                        <img src="{{ url_for('static',filename='images/ss.png') }}" width="50%">
            </p>
            <i class="glyphicon glyphicon-heart red"></i><h2>{{ user.name }}</h2> <i class="glyphicon glyphicon-heart red"></i> <!-- {{ user.liked }}
            {% if user.status %}<p>{{ user.status }}</p>{% endif %} -->
            
            <br>
            {% if current_user.is_authenticated and user != current_user and user.is_following(current_user) %}
            <!-- <p class="label label-default">他/她在关注你</p><br><br> -->
            {% endif %}
            {% if user != current_user %} <!--current_user.can(Permission.FOLLOW) and -->
            {% if not current_user.is_authenticated or not current_user.is_following(user) %}
            <!-- <a href="{{ url_for('.follow', username=user.username) }}" class="btn btn-primary">关注</a> -->
            {% else %}
            <div class="btn-group" role="group">
                <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown"
                        aria-haspopup="true"
                        aria-expanded="false">
                    已关注
                    <span class="caret"></span>
                </button>
                <ul class="dropdown-menu">
                    <li><a href="{{ url_for('.unfollow', username=user.username) }}">取消关注</a></li>
                </ul>
            </div>
            {% endif %}
            {% endif %}
        </div>
        
        <hr>
        <div class="data-area">
            <!-- <i class="glyphicon glyphicon-user"></i>
            关注者<a href="{{ url_for('.followers', username=user.username) }}"><span class="badge">{{ user.followers.count() }}</span></a>
            <br>
            <i class="glyphicon glyphicon-user"></i>
            正在关注<a href="{{ url_for('.followed_by', username=user.username) }}"><span class="badge">{{ user.followed.count() }}</span></a>
            <br> -->
            <i class="glyphicon glyphicon-th-large"></i> 相册{{ album_count }}个
            <br>
            <i class="glyphicon glyphicon-picture"></i> 照片{{ photo_count }}张
            <br>
             <i class="glyphicon glyphicon-heart"></i> {{ user.status }}
            <br>
            {% if user.location %}
            <i class="glyphicon glyphicon-map-marker"></i>
            <a href="#">{{ user.location }}</a><br>
            {% endif %}
            {% if current_user.is_administrator() %}
            <a href="mailto:{{ user.email }}">{{ user.email }}</a><br>
            {% endif %}
            {% if user.website %}
            <i class="glyphicon glyphicon-link"></i>
            <a href="{{ user.website }}" target="_blank">{{ user.website }}</a><br>
            {% endif %}
            
            <!-- <i class="glyphicon glyphicon-repeat"></i>
            {{ moment(user.member_since).format('YYYY/M') }}加入 -->
        </div>
        
        {% if user.about_me %}
        <hr>
        <div class="about-area">
            {{ about_me|safe }}
        </div>
        {% endif %}
        <hr>
        <div class="about-area">
            <h4>订阅更新:</h4> 
            输入您常用邮箱，当"笑话"发生更新时将会第一时间通知您~<br>
            {{ wtf.quick_form(form_dingyue) }}
        </div>
         {% if  current_user.is_authenticated %}
            当前订阅用户: {{ zz }}
         {% endif %}
    </div>
</div>

<div class="text-center">
    {{ macros.pagination_widget(pagination, '.albums', username=user.username) }}
</div>
<hr>

<!-- <div class="row">
    <h3>留言板</h3>
    {{ wtf.quick_form(form) }}
    <div id="comment">
        {% include '_comments.html' %}
    </div>
</div> -->
<script>
    function sendmail() {
        alert("test")
        // body...
    }
</script>

{% endblock %}